import request from '@/utils/request'

// export function getDepartments() {
//   return request({
//     url: '/company/department'
//   })
// }
export const getDepartments = () => request.get('/company/department')

// export function addDepartments(data) {
//   return request({
//     url: '/company/department',
//     method: 'post',
//     data
//   })
// }

export const addDepartments = (data) => request.post('/company/department')

// export function delDepartments(id) {
//   return request({
//     url: '/company/department/' + id,
//     method: 'delete'
//   })
// }
export const delDepartments = (id) => request.delete('/company/department/' + id)

// export function getDepartDetail(id) {
//   return request({
//     url: '/company/department/' + id,
//     method: 'get'
//   })
// }

export const getDepartDetail = (id) => request.get('/company/department/' + id)

/**
  * @description: 更新部门数据
  * @param {*} data:form表单数据 但是要有id值
  * @return {*}
  */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

